import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
 
  base:"/chatwoot-widget",
  plugins: [
    vue(),
  ],
  server: {
    host: '0.0.0.0',
    open: true,
    proxy: {
      '/api/business': {
        changeOrigin: true,
        target: 'http://192.168.0.106:8101',
        // target: 'http://3.80.61.165:8000',
        // target: 'http://127.0.0.0.1:8101',
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
      
    },
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
